<template>
  <!-- <DraggableSetting/> -->
  <HeaderBanner v-if="showHeader"/>
  <moduleBanner @handleType="handleType"  v-if="showHeader"/>
  <component :is='plateModule'></component> 
 
</template>   
 
<script setup lang="ts">
  import { ref } from 'vue';
  import {useCommomStore} from "@/pinia/store/commom.pinia"
  import {storeToRefs} from 'pinia'; 
  
  import HeaderBanner from '@/components/header/HeaderBanner.vue';
  import moduleBanner from '@/components/header/moduleBanner.vue';
  import modelPage from '@/components/modelPage/modelPage.vue';
  import modelPageST from '@/components/modelPage/modelPageST.vue';
  import modelPageGIS from '@/components/modelPage/modelPageGIS.vue';
  import modelPageMY from '@/components/modelPage/modelPageMY.vue';
  import modelPageCL from '@/components/modelPage/modelPageCL.vue';
  import modelPagePZ from '@/components/modelPage/modelPagePZ.vue';
  import modelPageTX from '@/components/modelPage/modelPageTX.vue';
  import modelPageGJ from '@/components/modelPage/modelPageGJ.vue';
  import modelPageTJ from '@/components/modelPage/modelPageTJ.vue';
  // import DraggableSetting from '@/components/header/DraggableSetting.vue';
 const storeCommomStore = useCommomStore();
const {showHeader} =  storeToRefs(storeCommomStore)
 
  const plateModule=ref(modelPage);
  const handleType=(type:string)=>{
    switch (type.id){
       case 0:
        plateModule.value= modelPage
        break;
         case 1:
        plateModule.value= modelPageST
        break;
         case 2:
        plateModule.value= modelPageGIS
        break;
          case 3:
        plateModule.value= modelPageMY
        break;
           case 4:
        plateModule.value= modelPageCL
        break;
            case 5:
        plateModule.value= modelPagePZ
        break;
             case 6:
        plateModule.value= modelPageTX
        break;
             case 7:
        plateModule.value= modelPageGJ
        break;
             case 8:
        plateModule.value= modelPageTJ
        break;
        default :
        break;
    }
     console.log(type);
     
  }
</script>
 
<style lang="scss"> 
</style>